<template>
  <div id="app" v-loading="isJiaz">
    <div id="nav"></div>
    <router-view/>
    <div id="loading" class="loadnone">
      <div class="el-loading-mask">
        <div class="el-loading-spinner">
          <svg  class="circular" viewBox="25 25 50 50">
            <circle class="path" cx="50" cy="50" r="20" fill="none"/>
          </svg>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import config from '../public/config';
export default {
  name: "App",
  data() {
    return {
      isRouterAlive: true, //控制视图是否显示的变量
      isJiaz: false,
    };
  },
  watch:{
  },
  mounted() {
    this.$axios.interceptors.request.use(config=> {
      this.isJiaz = true;
      return config;
    });
    this.$axios.interceptors.response.use(response=> {
      this.isJiaz = false;
      return response;
    });
  },
  methods: {
    reload() {
      this.isRouterAlive = false; //先关闭，
      this.$nextTick(function() {
        this.isRouterAlive = true; //再打开
      });
    },
  },
};
</script>

<style src="./assets/styles/main.css"></style>
<style lang="less">

</style>
